package com.njuse.jvmfinal.Instruction;

import java.nio.ByteBuffer;

import com.njuse.jvmfinal.runtimestructure.Jframe;

public class ICONST_N extends Instruction{
   private int number;
   
   public ICONST_N(int n) {
	   this.number=n;
   }
   
	public  void readindex(ByteBuffer reader) {
		//no need to read
	}
	
	public  void execute(Jframe frame) {
		int top=frame.getStacktop();
		Object[] stack=frame.getManagestack();
		stack[top]=number;
		top++;
		frame.setManagestack(stack);
		frame.setStacktop(top);
	}
   
   
}
